package cn.tedu.toa.management.sys.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 资源管理
 * </p>
 *
 * @author huaqian
 * @since 2021-09-09
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("sys_menus")
public class SysMenus extends Model<SysMenus> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 资源名称
     */
    @TableField("name")
    private String name;

    /**
     * 资源URL
     */
    @TableField("url")
    private String url;

    /**
     * 类型     1：菜单   2：按钮
     */
    @TableField("type")
    private Integer type;

    /**
     * 排序
     */
    @TableField("sort")
    private Integer sort;

    /**
     * 备注
     */
    @TableField("note")
    private String note;

    /**
     * 父菜单ID，一级菜单为0
     */
    @TableField("parentId")
    private Integer parentId;

    /**
     * 授权(如：user:create)
     */
    @TableField("permission")
    private String permission;

    /**
     * 创建时间
     */
    @TableField("createdTime")
    private LocalDateTime createdTime;

    /**
     * 修改时间
     */
    @TableField("modifiedTime")
    private LocalDateTime modifiedTime;

    /**
     * 创建用户
     */
    @TableField("createdUser")
    private String createdUser;

    /**
     * 修改用户
     */
    @TableField("modifiedUser")
    private String modifiedUser;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
